This is the second part of a two-part vignette designed to collect and analyze Twitter posts from Boston and Guatemala by searching for location hashtags. This part of the vignette carries out the database initialization and initial status collections. This part of the vignette consists of two sub-parts: (a) updating the twitter database with new posts, and (b) analysis. These two sub-parts can be run together or independently, as often as required.
We begin by loading the twinfoR namespace, establishing the Twitter database connection to the sqlite database created in Part I of this vignette, and loading the authentication vector. See (and execute) the location_search_1 vignette if you haven’t already done so.
This code assumes the auth.vector from Part I is saved. If it isn’t, reauthenticate using the authorize_IT() function as done in Part I.
This function should take considerably less time to run than the initial call, because it only collects new statuses.
update_search(
con
)
# Summarize database
summarize_database(con)
#> No query user table.
#> Search queries: 4
#> Search categories:
#> location
#> since_id
#> Users: 11454
#> Statuses: 21860
#> Unique user mentions: 5633
#> Unique hashtags: 16021
#> Unique URLs: 7303
#> Total Images: 6385
#> Unique Images: 5472
#> Total relationships: 0
#> Database file size: 88MBThe summary output from the last section shows the columns of the query_text table. Let’s take a closer look at this table, which we created in Part I of this vignette.
| id | query_text | location | since_id |
|---|---|---|---|
| 1 | #Boston | Boston | 1086382976902942721 |
| 2 | #GuatemalaCity | Guatemala City | 1086352390666756098 |
| 3 | #CiudaddeGuatemala | Guatemala City | 1086135555807690752 |
| 4 | #CiudadGuatemala | Guatemala City | 1085775331158577152 |
Any column in this table can be used as where.criteria in the analysis functions. We are going to use the location column.
topusermentions.boston <- top_usermentions(
con,
start.date = Sys.Date()-7,
where.criteria = "query_text.location = 'Boston'"
)
topusermentions.GC <- top_usermentions(
con,
start.date = Sys.Date()-7,
where.criteria = "query_text.location = 'Guatemala City'"
)
knitr::kable(
data.frame(
Screen_Name = paste("@",topusermentions.boston$user_mention_screen_name,sep=""),
Name = topusermentions.boston$user_mention_name,
Mentions = topusermentions.boston$n,
stringsAsFactors = FALSE
),
caption = "Boston User Mentions"
)| Screen_Name | Name | Mentions |
|---|---|---|
| @SportsDen2016 | East Coast Sports | 523 |
| @redostoneage | Truth Tweeter | 329 |
| @marty_walsh | Mayor Marty Walsh | 321 |
| @FerRaverta | Fernanda Raverta | 244 |
| @wizard_leather | TheWizardOfLeather | 185 |
| @Patriots | New England Patriots | 172 |
| @surjboston | SURJ Boston | 126 |
| @KassandraSeven | Kassandra Seven | 126 |
| @CityOfBoston | City of Boston | 120 |
| @malunahe | María Navarro | 105 |
knitr::kable(
data.frame(
Screen_Name = paste("@",topusermentions.GC$user_mention_screen_name,sep=""),
Name = topusermentions.GC$user_mention_name,
Mentions = topusermentions.GC$n,
stringsAsFactors = FALSE
),
caption = "Guatemala City User Mentions"
)| Screen_Name | Name | Mentions |
|---|---|---|
| @CRGuatemalteca | CruzRojaGT | 5 |
| @CityMaxMix | CityMax Mix | 3 |
| @EmixtraPablo | Pablo Morales | 2 |
| @spadegraphics | Spade Graphics by Dave OfTheJungle | 2 |
| @ElLuchin1 | TEMBLOR ⚡️ | 2 |
| @info502 | Guatemala | 1 |
| @goldmindslatino | goldmindslatino | 1 |
| @Spotify | Spotify | 1 |
| @republicagt | República | 1 |
| @mary_sor | Sor Mary Lopez | 1 |
topurls.boston <- top_urls(
con,
start.date = Sys.Date()-7,
where.criteria = "query_text.location = 'Boston'"
)
topurls.GC <- top_urls(
con,
start.date = Sys.Date()-7,
where.criteria = "query_text.location = 'Guatemala City'"
)
knitr::kable(
list(
Boston = data.frame(
Boston.URL = topurls.boston$extended_url,
Count = topurls.boston$n,
stringsAsFactors = FALSE
),
"Guatemala City" = data.frame(
GuatemalaCity.URL = topurls.GC$extended_url,
Count = topurls.GC$n,
stringsAsFactors = FALSE
)
),
caption = "Top Boston and Guatemala City URLs"
)topmedia.boston <- top_media(
con,
start.date = Sys.Date()-14,
where.criteria = "query_text.location = 'Boston'",
save.to.file = FALSE
)
topmedia.GC <- top_media(
con,
start.date = Sys.Date()-14,
where.criteria = "query_text.location = 'Guatemala City'",
save.to.file = FALSE
)
knitr::kable(
list(
data.frame(
Boston.image_url = topmedia.boston$media_url,
count = topmedia.boston$n,
stringsAsFactors = FALSE
),
data.frame(
GuatemalaCity.image_url = topmedia.GC$media_url,
count = topmedia.GC$n,
stringsAsFactors = FALSE
)
),
caption = "Top Media Posted by Boston and Guatemala City"
)
|
|
## Top Boston Image (Not Run)
# status_media(
# topmedia.boston[1,],
# con,
# update.media.b64 = FALSE,
# display.image = TRUE
# )
## Top Guatemala City Image (Not Run)
# status_media(
# topmedia.GC[1,],
# con,
# update.media.b64 = FALSE,
# display.image = TRUE
# )|
|
|
| Top Boston Image | Top Guatemala City Image |
The top_media and status_media have many options for saving and rendering images. See documentation for details.
toptweeters.boston <- top_tweeters(
con,
start.date = Sys.Date()-7,
where.criteria = "query_text.location = 'Boston'"
)
toptweeters.GC <- top_tweeters(
con,
start.date = Sys.Date()-7,
where.criteria = "query_text.location = 'Guatemala City'"
)
toptweeters.boston$description <- gsub("\n"," -- ",toptweeters.boston$description)
toptweeters.boston$location <- gsub("\n"," -- ",toptweeters.boston$location)
toptweeters.GC$description <- gsub("\n"," -- ",toptweeters.GC$description)
toptweeters.GC$location <- gsub("\n"," -- ",toptweeters.GC$location)
knitr::kable(
data.frame(
Name = toptweeters.boston$name,
Location = toptweeters.boston$location,
Description = toptweeters.boston$description,
Tweets = toptweeters.boston$n,
stringsAsFactors = FALSE
),
caption = "Top Boston Tweeters"
)| Name | Location | Description | Tweets |
|---|---|---|---|
| Truth Tweeter | Corrupt City of Chicago | I love America. I love our Constitution. I hope we return to our LIBERTARIAN values! #MAGA | 466 |
| María Navarro | Houston, TX | Team 🧙🏻♂️followizard❤️ #f4f #FollowMe #followback #Follow4follow #Followher #USA🇺🇸🇺🇸 #Houston #Texas | 184 |
| Roxanne Shelaider | Malibu, CA | 🇺🇸🇺🇸🇺🇸🇺🇸🇺🇸 I´m a #Malibu fashion lover team #followizard #Followme #follow4follow, #f4f #Followback #follower #USA 🇺🇸🇺🇸🇺🇸🇺🇸🇺🇸 | 169 |
| Nathalie Watson | Ottawa, Ontario | America’s 1st Job Alert System | 98 |
| TheRealBostonSegway | Boston, MA | Don’t be fooled, there’s only one! Right in the heart of it all at 199 State St. and we are The best way to see the city! 617-421-1234 https://t.co/RTeeSA3dL8 | 90 |
| Boston Plow | Internet | A new #Boston community with less noise & junk on @plowio. Follow for an invite to join our open beta! | 89 |
| #Londonislovinit | London | Promoting everything that is #LONDON under the Hashtag #Londonislovinit Use this 4 a RT everytime #Londonhour every Thurs 8-9pm adam@atsocialmedia.co.uk 👊 | 89 |
| Boston Jobs | Boston, MA | Find Jobs and Work in Boston, Massachusetts at https://t.co/OZ8R0vTPpw! – – #BOSTON #MA #WORK #JOBS #CAREER #EMPLOY #CELTICS #REDSOX #BRUINS #CANNONS #BLADES | 71 |
| East Coast Sports | FT Lauderdale, FLA | Welcome to East Coast Sports! We Specialize in RARE Autographed New England Sports Memorabilia, and RARE items signed by Legends of the game both Past & Present | 69 |
| Timothy Breitzmann | Chicago | Follow my link, check out my art @ Society6. We need to put down our hate and reach for Enlightenment or this Human experiment will not end well for any of us. | 68 |
knitr::kable(
data.frame(
Name = toptweeters.GC$name,
Location = toptweeters.GC$location,
Description = toptweeters.GC$description,
Tweets = toptweeters.GC$n,
stringsAsFactors = FALSE
),
caption = "Top Guatemala City Tweeters"
)| Name | Location | Description | Tweets |
|---|---|---|---|
| IO al Desnudo ™🇬🇹 | Guatemala | Comunicólogo, #AmoGuate #BuenaVibra | 10 |
| Raúl Contreras | Guatemala | En la vida nada es caSUalidad, todo es caUSalidad. ¡Así es la vida! | 5 |
| Jfranco87 | Guatemala | Café 87 | 5 |
| Guatemala | 4 | ||
| Zo | United States | GOD . FAMILY . TRAVELER . RISK TAKER . AAMU ALUM . GLOBAL MARKETING | 4 |
| CityMax Mix | Guatemala | #1 en Bienes Raices | 4 |
| вяαd αѕтυяιαѕ t(’’t• | Guatemala | Fisicoculturista Guatemalteco 🇬🇹 ™🏃20 años de edad •Entrenador Personal 💯🏋🏽Instagram- bradasturias 👻Snap- brad_asturias #Björk 🖤 | 3 |
| CITYMAX Guatemala | Guatemala | Franquicia Bienes Raices Ciudad Guatemala, Apartamentos, Casas, Locales Comerciales, Edificios, Terrenos, Oficinas y Bodegas Renta/Venta ☎️PBX(502)2493-5555 | 3 |
| Spade Graphics by Dave OfTheJungle | Guatemala | Proud member of Zoey Love Art and Spade Graphics | 3 |
| Nancy Yarelis Cortez Surque | Guatemala | 3 |
mostliked.boston <- most_liked(
con,
start.date = Sys.Date()-7,
where.criteria = "query_text.location = 'Boston'"
)
mostliked.GC <- most_liked(
con,
start.date = Sys.Date()-7,
where.criteria = "query_text.location = 'Guatemala City'"
)
# For nice Markdown rendering
mostliked.boston$description <- gsub("\n"," -- ",mostliked.boston$description)
mostliked.boston$location <- gsub("\n"," -- ",mostliked.boston$location)
mostliked.boston$text <- gsub("\n"," -- ",mostliked.boston$text)
mostliked.boston$name <- gsub("\n"," -- ",mostliked.boston$name)
mostliked.GC$description <- gsub("\n"," -- ",mostliked.GC$description)
mostliked.GC$location <- gsub("\n"," -- ",mostliked.GC$location)
mostliked.GC$text <- gsub("\n"," -- ",mostliked.GC$text)
mostliked.GC$name <- gsub("\n"," -- ",mostliked.GC$name)
knitr::kable(
data.frame(
Name = mostliked.boston$name,
Created = mostliked.boston$created_at,
Likes = mostliked.boston$favorite_count,
Text = mostliked.boston$text,
stringsAsFactors = FALSE
),
caption = "Most Liked Boston Tweets"
)| Name | Created | Likes | Text |
|---|---|---|---|
| Joey McIntyre | 2019-01-14 04:05:01 | 955 | Great day for #Boston- @patriots win big and so does Kira Mac 😊 – 1st All-Around at Boston Invitational. – #proudpapa #kiwakiwa 😭 https://t.co/wyQn3FKKue |
| Sarah Shahi | 2019-01-14 23:18:39 | 703 | You’ll want to 🤛🏼 her and 💋 her at the same time. Meet Rachel. Get ready. She’s dynamite in a tiny package @BenAffleck @AldisHodge @jonathanmtucker @Showtime #Boston #wickedsmaht https://t.co/TKaDV9PQM6 |
| BostonTweet | 2019-01-11 22:19:13 | 424 | Brrrr #Boston https://t.co/WtYCPP6cIA |
| Fernanda Raverta | 2019-01-16 17:41:18 | 351 | ¿Qué es la pedagogía de la crueldad? – – Un operativo en plena madrugada con más de 200 efectivos para desalojar a trabajadores que fueron víctimas del vaciamiento de una empresa. – – Mi mayor repudio a este accionar de la Justicia y mi solidaridad con los trabajadores de la #Boston https://t.co/FgzdBs5iuI |
| David Wade | 2019-01-16 00:12:01 | 329 | Of all the stores that have closed in #Boston through the years, Filene’s Basement is the one I miss most. And it’s not even close. How about you? https://t.co/19wfYHaN7b |
| Red | 2019-01-13 21:36:18 | 312 | Daily reminder that Gods walk among us. #Boston #Sports #Blessed https://t.co/oHEtAbc1S5 |
| Ayanna Pressley | 2019-01-15 23:10:23 | 296 | Point of clarification: Just so there is no confusion or trouble, especially on today. I am not a member of #AKA I am however a proud sister of @linksinc #Boston chapter. Many of my link sisters & new #CBC colleagues (see Lauren below) are Happy #FoundersDay #HU #1908 #sisterhood https://t.co/lpmMtXLLpY |
| Luis Bremer | 2019-01-16 14:19:24 | 175 | Donde había una fuente de trabajo y las medialunas más ricas de Mardel….. #Tristeza #Boston #MardelPlata https://t.co/4UAOZgjCRk |
| Ahmed/DaBaby Fan Account | 2019-01-15 22:19:39 | 163 | i think Carmelo Anthony would be perfect for the @celtics , they need the veteran leadership that Kyrie is looking for right now in their recent struggles. – – #CelticNation #Boston https://t.co/HNUi91CB3e |
| Kassandra Seven | 2019-01-13 14:09:00 | 153 | This food bank is serving #Boston-area #USCoastGuard members who are not being paid due to the #shutdown. – – Please spread the word and consider donating. – – Massachusetts Military Support Foundation https://t.co/Xklih0IxFQ |
knitr::kable(
data.frame(
Name = mostliked.GC$name,
Created = mostliked.GC$created_at,
Likes = mostliked.GC$favorite_count,
Text = mostliked.GC$text,
stringsAsFactors = FALSE
),
caption = "Most Liked Guatemala City Tweets"
)| Name | Created | Likes | Text |
|---|---|---|---|
| José E. Valdizán | 2019-01-14 14:38:08 | 6 | Edificio del Banco Industrial y Plazuela 11 de marzo #guatemala #guatemalacity #streets #guate #streetstyle #streetview #view #streetlife #city #citylife #centralamerica #dji… https://t.co/GmIbX4nR9b |
| CruzRojaGT | 2019-01-12 17:53:25 | 6 | #CiudadDeGuatemala – – Accidente de tránsito se suscita en 8av 2Calle zona 1, dos vehículos colisionan, socorristas de #CruzRojaGT le brindaron atención prehospitalaria a una persona con heridas leves en el lugar, no ameritó ser trasladada. https://t.co/rCUw93iwvT |
| TEMBLOR ⚡️ | 2019-01-12 19:53:24 | 4 | 🇬🇹➡#Temblor 4.3⚡ ⏱12:51 Pm H/Guatemala🇬🇹 – 🔶#SanJose Puerto a 62 Km al Sur de #Iztapa – Profundidad 🔰43 Kms – Sur de #CiudadDeGuatemala – D. de #Escuintla – #Sismo #FelizSabado – #Earthquake #12Ene – #TemblorGT https://t.co/5hF1R0T03x |
| José E. Valdizán | 2019-01-18 07:05:49 | 3 | Vista Hermosa zona 15, Guatemala #cityscape #city #guatemala #guatemalacity #guate #guategram #view #drone #droneview #dronestagram #vistahermosaguatemala #life #citylife #citylifestyle… https://t.co/IX3ImlKSel |
| CityMax Mix | 2019-01-16 20:55:37 | 3 | Apartamento con Linea Blanca en Parque 11 – – Renta Q5,000.00 mantenimiento incluido, dos habitaciones, 2 baños. – – #CityMaxMIX #RealEstateGuatemala #GuatemalaCity #realestateMIX #TuProfesionalInmobiliario #RealEstate #Mixco https://t.co/voPzn9Xm3Q |
| TEMBLOR ⚡️ | 2019-01-12 19:52:50 | 3 | 🇬🇹➡#Temblor 4.3 ⚡ ⏱12:51 Pm H/Guatemala🇬🇹 – 🔶#SanJose Puerto a 62 Km al Sur de #Iztapa – Profundidad 🔰43 Kms – Sur de #CiudadDeGuatemala – D. de #Escuintla – #Sismo #FelizSabado – #Earthquake #12Ene – #TemblorGT https://t.co/ze8zg8k183 |
| CityMax Mix | 2019-01-15 21:18:26 | 2 | ¡Bodega en San Cristobal! – - Terreno de 9 por 20 – - 325m² totales de construcción – - Mezzanine de 56m² – - 1.5 baños – - Energía eléctrica bifasica – - Instalación de agua potable municipal – - 8 espacios para estacionamiento – #CityMaxMIX #RealEstateGuatemala #GuatemalaCity #realestateMIX https://t.co/Vekq3mCnop |
| CityMax Mix | 2019-01-14 20:41:57 | 2 | ¡Casa cerca de Sankris Mall! – – De dos niveles, con 3 habitaciones con closets, 2 baños completos, espacio para 2 vehículos. – – Venta Q700,000.00 – – #CityMaxMIX #RealEstateGuatemala #GuatemalaCity #realestateMIX #TuProfesionalInmobiliario #RealEstate #Mixco https://t.co/9jg1i00xXR |
| вяαd αѕтυяιαѕ t(’’t• | 2019-01-11 02:54:14 | 2 | ⭕️⭕️ – – #BradAsturias #TeamArango #LOCO #PersonalTrainer #ChaosGuatemala #Diet – #Ripped #alphanutrition #Guatemalacity #generationiron #fitnessgym #bodybuilding #training #best… https://t.co/dH6DRnCIHm |
| goldmindslatino | 2019-01-17 15:11:36 | 2 | #conferencia #presencial de #forex este 26 de Enero en #ciudaddeguatemala. #aprende Con nosotros sin Redes de #mercadeo ni pagos mensuales. Pares de enfoque: #xauusd #gbpjpy. #estrategias de otro #nivel totalmente en #español |
mostretweeted.boston <- most_retweeted(
con,
start.date = Sys.Date()-7,
where.criteria = "query_text.location = 'Boston'"
)
mostretweeted.GC <- most_retweeted(
con,
start.date = Sys.Date()-7,
where.criteria = "query_text.location = 'Guatemala City'"
)
# For nice Markdown rendering
mostretweeted.boston$description <- gsub("\n"," -- ",mostretweeted.boston$description)
mostretweeted.boston$location <- gsub("\n"," -- ",mostretweeted.boston$location)
mostretweeted.boston$text <- gsub("\n"," -- ",mostretweeted.boston$text)
mostretweeted.boston$name <- gsub("\n"," -- ",mostretweeted.boston$name)
mostretweeted.GC$description <- gsub("\n"," -- ",mostretweeted.GC$description)
mostretweeted.GC$location <- gsub("\n"," -- ",mostretweeted.GC$location)
mostretweeted.GC$text <- gsub("\n"," -- ",mostretweeted.GC$text)
mostretweeted.GC$name <- gsub("\n"," -- ",mostretweeted.GC$name)
knitr::kable(
data.frame(
Name = mostretweeted.boston$name,
Created = mostretweeted.boston$created_at,
Retweet_Count = mostretweeted.boston$retweet_count,
Text = mostretweeted.boston$text,
stringsAsFactors = FALSE
),
caption = "Most Retweeted Boston Tweets"
)| Name | Created | Retweet_Count | Text |
|---|---|---|---|
| Fernanda Raverta | 2019-01-16 17:41:18 | 268 | ¿Qué es la pedagogía de la crueldad? – – Un operativo en plena madrugada con más de 200 efectivos para desalojar a trabajadores que fueron víctimas del vaciamiento de una empresa. – – Mi mayor repudio a este accionar de la Justicia y mi solidaridad con los trabajadores de la #Boston https://t.co/FgzdBs5iuI |
| MoreCoin | 2019-01-11 17:30:19 | 196 | Which $MORE party are you going to? #Hollywood #OC #Boston #Miami #Chicago? 18 places to use crypto. #usecase #adoption #iwantmore #bittrex #blockchain #cryptotequila https://t.co/7YuE4EvPlW |
| Kassandra Seven | 2019-01-13 14:09:00 | 155 | This food bank is serving #Boston-area #USCoastGuard members who are not being paid due to the #shutdown. – – Please spread the word and consider donating. – – Massachusetts Military Support Foundation https://t.co/Xklih0IxFQ |
| Sarah Shahi | 2019-01-14 23:18:39 | 79 | You’ll want to 🤛🏼 her and 💋 her at the same time. Meet Rachel. Get ready. She’s dynamite in a tiny package @BenAffleck @AldisHodge @jonathanmtucker @Showtime #Boston #wickedsmaht https://t.co/TKaDV9PQM6 |
| Luis Bremer | 2019-01-16 14:19:24 | 75 | Donde había una fuente de trabajo y las medialunas más ricas de Mardel….. #Tristeza #Boston #MardelPlata https://t.co/4UAOZgjCRk |
| Joey McIntyre | 2019-01-14 04:05:01 | 65 | Great day for #Boston- @patriots win big and so does Kira Mac 😊 – 1st All-Around at Boston Invitational. – #proudpapa #kiwakiwa 😭 https://t.co/wyQn3FKKue |
| It’s Going Down | 2019-01-18 11:06:24 | 63 | Saturday in #Boston, a variety of anti-racist organizations are mobilizing against a group of neo-Nazis with Resist Marxism - who are planning to crash the #WomensMarch. A small group of #ProudBoys also claim they will wear disguises to attend in #Orlando. https://t.co/DvzFhHDz47 https://t.co/bwF6XT7VrL |
| Carbon Black, Inc. | 2019-01-14 21:27:23 | 63 | Honored to be named the best place to work in #Boston this year by @BuiltinBOS. We remain committed to investing in the growth of our employees, and are excited for the opportunities that #2019 has in store for us - https://t.co/CCCHBQToWe |
| Today In History | 2019-01-17 05:14:00 | 59 | Today in 1706: American #statesman Benjamin #Franklin is born in #Boston. He is the youngest boy in a family of 17 children. Among his many accomplishments, he helped draft the Declaration of #Independence. He died on April 17, 1790. #history #AmericanHistory https://t.co/hcVqQB5xOl |
| Ahmed/DaBaby Fan Account | 2019-01-15 22:19:39 | 51 | i think Carmelo Anthony would be perfect for the @celtics , they need the veteran leadership that Kyrie is looking for right now in their recent struggles. – – #CelticNation #Boston https://t.co/HNUi91CB3e |
knitr::kable(
data.frame(
Name = mostretweeted.GC$name,
Created = mostretweeted.GC$created_at,
Retweet_Count = mostretweeted.GC$retweet_count,
Text = mostretweeted.GC$text,
stringsAsFactors = FALSE
),
caption = "Most Retweeted Guatemala City Tweets"
)| Name | Created | Retweet_Count | Text |
|---|---|---|---|
| CruzRojaGT | 2019-01-12 17:53:25 | 4 | #CiudadDeGuatemala – – Accidente de tránsito se suscita en 8av 2Calle zona 1, dos vehículos colisionan, socorristas de #CruzRojaGT le brindaron atención prehospitalaria a una persona con heridas leves en el lugar, no ameritó ser trasladada. https://t.co/rCUw93iwvT |
| WorldShare | 2019-01-18 13:00:34 | 1 | The thousands of people living around the rubbish dump in #GuatemalaCity are exposed to dangerous living conditions daily. Our partner Potter’s House work to provide protection and safety as well as developing self-worth and hope. https://t.co/XTzDySKj0R https://t.co/5lavH76xuM |
| José E. Valdizán | 2019-01-18 07:05:49 | 1 | Vista Hermosa zona 15, Guatemala #cityscape #city #guatemala #guatemalacity #guate #guategram #view #drone #droneview #dronestagram #vistahermosaguatemala #life #citylife #citylifestyle… https://t.co/IX3ImlKSel |
| CityMax Mix | 2019-01-16 20:55:37 | 1 | Apartamento con Linea Blanca en Parque 11 – – Renta Q5,000.00 mantenimiento incluido, dos habitaciones, 2 baños. – – #CityMaxMIX #RealEstateGuatemala #GuatemalaCity #realestateMIX #TuProfesionalInmobiliario #RealEstate #Mixco https://t.co/voPzn9Xm3Q |
| CityMax Mix | 2019-01-15 21:18:26 | 1 | ¡Bodega en San Cristobal! – - Terreno de 9 por 20 – - 325m² totales de construcción – - Mezzanine de 56m² – - 1.5 baños – - Energía eléctrica bifasica – - Instalación de agua potable municipal – - 8 espacios para estacionamiento – #CityMaxMIX #RealEstateGuatemala #GuatemalaCity #realestateMIX https://t.co/Vekq3mCnop |
| CityMax Mix | 2019-01-14 20:41:57 | 1 | ¡Casa cerca de Sankris Mall! – – De dos niveles, con 3 habitaciones con closets, 2 baños completos, espacio para 2 vehículos. – – Venta Q700,000.00 – – #CityMaxMIX #RealEstateGuatemala #GuatemalaCity #realestateMIX #TuProfesionalInmobiliario #RealEstate #Mixco https://t.co/9jg1i00xXR |
| goldmindslatino | 2019-01-17 15:11:36 | 1 | #conferencia #presencial de #forex este 26 de Enero en #ciudaddeguatemala. #aprende Con nosotros sin Redes de #mercadeo ni pagos mensuales. Pares de enfoque: #xauusd #gbpjpy. #estrategias de otro #nivel totalmente en #español |
| Guatemala | 2019-01-16 16:50:19 | 1 | OTRA OPCIÓN AL #TRÁNSITOGT – – De ingreso a #CiudadDeGuatemala por el sur del país. Tome nota de otra vía al #TráficoGT. https://t.co/zpTq2SRywb |
| TEMBLOR ⚡️ | 2019-01-12 19:53:24 | 1 | 🇬🇹➡#Temblor 4.3⚡ ⏱12:51 Pm H/Guatemala🇬🇹 – 🔶#SanJose Puerto a 62 Km al Sur de #Iztapa – Profundidad 🔰43 Kms – Sur de #CiudadDeGuatemala – D. de #Escuintla – #Sismo #FelizSabado – #Earthquake #12Ene – #TemblorGT https://t.co/5hF1R0T03x |
| TEMBLOR ⚡️ | 2019-01-12 19:52:50 | 1 | 🇬🇹➡#Temblor 4.3 ⚡ ⏱12:51 Pm H/Guatemala🇬🇹 – 🔶#SanJose Puerto a 62 Km al Sur de #Iztapa – Profundidad 🔰43 Kms – Sur de #CiudadDeGuatemala – D. de #Escuintla – #Sismo #FelizSabado – #Earthquake #12Ene – #TemblorGT https://t.co/ze8zg8k183 |
mostpopRT.boston <- most_popular_RT_in_sample(
con,
start.date = Sys.Date()-7,
where.criteria = "query_text.location = 'Boston'"
)
mostpopRT.GC <- most_popular_RT_in_sample(
con,
start.date = Sys.Date()-7,
where.criteria = "query_text.location = 'Guatemala City'"
)
# For nice Markdown rendering
mostpopRT.boston$description <- gsub("\n"," -- ",mostpopRT.boston$description)
mostpopRT.boston$location <- gsub("\n"," -- ",mostpopRT.boston$location)
mostpopRT.boston$text <- gsub("\n"," -- ",mostpopRT.boston$text)
mostpopRT.boston$name <- gsub("\n"," -- ",mostpopRT.boston$name)
mostpopRT.GC$description <- gsub("\n"," -- ",mostpopRT.GC$description)
mostpopRT.GC$location <- gsub("\n"," -- ",mostpopRT.GC$location)
mostpopRT.GC$text <- gsub("\n"," -- ",mostpopRT.GC$text)
mostpopRT.GC$name <- gsub("\n"," -- ",mostpopRT.GC$name)
knitr::kable(
data.frame(
Name = mostpopRT.boston$name,
Created = mostpopRT.boston$created_at,
Dem_Retweets = mostpopRT.boston$n,
Text = mostpopRT.boston$text,
stringsAsFactors = FALSE
),
caption = "Most Popular Retweets Among Boston"
)| Name | Created | Dem_Retweets | Text |
|---|---|---|---|
| Fernanda Raverta | 2019-01-16 17:41:18 | 244 | ¿Qué es la pedagogía de la crueldad? – – Un operativo en plena madrugada con más de 200 efectivos para desalojar a trabajadores que fueron víctimas del vaciamiento de una empresa. – – Mi mayor repudio a este accionar de la Justicia y mi solidaridad con los trabajadores de la #Boston https://t.co/FgzdBs5iuI |
| Kassandra Seven | 2019-01-13 14:09:00 | 126 | This food bank is serving #Boston-area #USCoastGuard members who are not being paid due to the #shutdown. – – Please spread the word and consider donating. – – Massachusetts Military Support Foundation https://t.co/Xklih0IxFQ |
| Sarah Shahi | 2019-01-14 23:18:39 | 64 | You’ll want to 🤛🏼 her and 💋 her at the same time. Meet Rachel. Get ready. She’s dynamite in a tiny package @BenAffleck @AldisHodge @jonathanmtucker @Showtime #Boston #wickedsmaht https://t.co/TKaDV9PQM6 |
| Luis Bremer | 2019-01-16 14:19:24 | 64 | Donde había una fuente de trabajo y las medialunas más ricas de Mardel….. #Tristeza #Boston #MardelPlata https://t.co/4UAOZgjCRk |
| It’s Going Down | 2019-01-18 11:06:24 | 64 | Saturday in #Boston, a variety of anti-racist organizations are mobilizing against a group of neo-Nazis with Resist Marxism - who are planning to crash the #WomensMarch. A small group of #ProudBoys also claim they will wear disguises to attend in #Orlando. https://t.co/DvzFhHDz47 https://t.co/bwF6XT7VrL |
| Joey McIntyre | 2019-01-14 04:05:01 | 57 | Great day for #Boston- @patriots win big and so does Kira Mac 😊 – 1st All-Around at Boston Invitational. – #proudpapa #kiwakiwa 😭 https://t.co/wyQn3FKKue |
| Carbon Black, Inc. | 2019-01-14 21:27:23 | 55 | Honored to be named the best place to work in #Boston this year by @BuiltinBOS. We remain committed to investing in the growth of our employees, and are excited for the opportunities that #2019 has in store for us - https://t.co/CCCHBQToWe |
| Today In History | 2019-01-17 05:14:00 | 51 | Today in 1706: American #statesman Benjamin #Franklin is born in #Boston. He is the youngest boy in a family of 17 children. Among his many accomplishments, he helped draft the Declaration of #Independence. He died on April 17, 1790. #history #AmericanHistory https://t.co/hcVqQB5xOl |
| City of Boston | 2019-01-15 22:09:08 | 45 | Tonight, Mayor @marty_walsh will give his annual State of the City address. The #SOTC2019 will review the City of #Boston’s progress and lay out the Mayor’s agenda for this year. You’ll be able to watch the live stream at https://t.co/k4bF6mHvMb @BostonCityTV https://t.co/oQPo9yHkUW |
| Michael Ventrice | 2019-01-16 11:32:20 | 40 | Our #IBM model 0z run from today is a winter weenie’s dream. The model is highlighting a historical snow/ice storm from the Ohio Valley up through NE. Literally snows over 30hours straight o/#Boston in this prediction. The model has been volatile so this will change next cycle. https://t.co/CNYkMdholA |
knitr::kable(
data.frame(
Name = mostpopRT.GC$name,
Created = mostpopRT.GC$created_at,
Rep_Retweets = mostpopRT.GC$n,
Text = mostpopRT.GC$text,
stringsAsFactors = FALSE
),
caption = "Most Popular Retweets Among Guatemala City"
)| Name | Created | Rep_Retweets | Text |
|---|---|---|---|
| CruzRojaGT | 2019-01-12 17:53:25 | 3 | #CiudadDeGuatemala – – Accidente de tránsito se suscita en 8av 2Calle zona 1, dos vehículos colisionan, socorristas de #CruzRojaGT le brindaron atención prehospitalaria a una persona con heridas leves en el lugar, no ameritó ser trasladada. https://t.co/rCUw93iwvT |
| CruzRojaGT | 2019-01-10 23:08:25 | 2 | #CiudadDeGuatemala – – Accidente de tránsito se suscita en 20 avenida 6Calle zona 6, tuc tuc y vehículo colisionan, socorristas de #CruzRojaGT le brindaron atención prehospitalaria y trasladan al @HospigenGT https://t.co/5rHaxKO76s |
| República | 2019-01-08 13:58:46 | 1 | Te deseamos la mejor de las mañanas con este frío amanecer desde San Francisco el Alto. – Regram @mary_sor – . – . – #guatemalacity #xela #quetzaltenango #antiguaguatemala – #sanfrancisco #mountain #sunrise #clouds #summit #chilling #inguat #visitguatemala @ClimaenGuate https://t.co/AuvIsVNHVm |
| MuniGuate | 2019-01-10 13:46:44 | 1 | Llovizna en varios sectores de #CiudadDeGuatemala. – Prudencia #TráficoGT, asfalto resbaloso. https://t.co/o6Ro0B9a38 |
| TEMBLOR ⚡️ | 2019-01-12 19:52:50 | 1 | 🇬🇹➡#Temblor 4.3 ⚡ ⏱12:51 Pm H/Guatemala🇬🇹 – 🔶#SanJose Puerto a 62 Km al Sur de #Iztapa – Profundidad 🔰43 Kms – Sur de #CiudadDeGuatemala – D. de #Escuintla – #Sismo #FelizSabado – #Earthquake #12Ene – #TemblorGT https://t.co/ze8zg8k183 |
| TEMBLOR ⚡️ | 2019-01-12 19:53:24 | 1 | 🇬🇹➡#Temblor 4.3⚡ ⏱12:51 Pm H/Guatemala🇬🇹 – 🔶#SanJose Puerto a 62 Km al Sur de #Iztapa – Profundidad 🔰43 Kms – Sur de #CiudadDeGuatemala – D. de #Escuintla – #Sismo #FelizSabado – #Earthquake #12Ene – #TemblorGT https://t.co/5hF1R0T03x |
| CityMax Mix | 2019-01-14 20:41:57 | 1 | ¡Casa cerca de Sankris Mall! – – De dos niveles, con 3 habitaciones con closets, 2 baños completos, espacio para 2 vehículos. – – Venta Q700,000.00 – – #CityMaxMIX #RealEstateGuatemala #GuatemalaCity #realestateMIX #TuProfesionalInmobiliario #RealEstate #Mixco https://t.co/9jg1i00xXR |
| CityMax Mix | 2019-01-15 21:18:26 | 1 | ¡Bodega en San Cristobal! – - Terreno de 9 por 20 – - 325m² totales de construcción – - Mezzanine de 56m² – - 1.5 baños – - Energía eléctrica bifasica – - Instalación de agua potable municipal – - 8 espacios para estacionamiento – #CityMaxMIX #RealEstateGuatemala #GuatemalaCity #realestateMIX https://t.co/Vekq3mCnop |
| Guatemala | 2019-01-16 16:50:19 | 1 | OTRA OPCIÓN AL #TRÁNSITOGT – – De ingreso a #CiudadDeGuatemala por el sur del país. Tome nota de otra vía al #TráficoGT. https://t.co/zpTq2SRywb |
| CityMax Mix | 2019-01-16 20:55:37 | 1 | Apartamento con Linea Blanca en Parque 11 – – Renta Q5,000.00 mantenimiento incluido, dos habitaciones, 2 baños. – – #CityMaxMIX #RealEstateGuatemala #GuatemalaCity #realestateMIX #TuProfesionalInmobiliario #RealEstate #Mixco https://t.co/voPzn9Xm3Q |
Note: this metric is of dubious value. See documentation.
mostreach.boston <- most_reach(
con,
start.date = Sys.Date()-7,
where.criteria = "query_text.location = 'Boston'"
)
mostreach.GC <- most_reach(
con,
start.date = Sys.Date()-7,
where.criteria = "query_text.location = 'Guatemala City'"
)
# For nice Markdown rendering
mostreach.boston$description <- gsub("\n"," -- ",mostreach.boston$description)
mostreach.boston$location <- gsub("\n"," -- ",mostreach.boston$location)
mostreach.boston$text <- gsub("\n"," -- ",mostreach.boston$text)
mostreach.boston$name <- gsub("\n"," -- ",mostreach.boston$name)
mostreach.GC$description <- gsub("\n"," -- ",mostreach.GC$description)
mostreach.GC$location <- gsub("\n"," -- ",mostreach.GC$location)
mostreach.GC$text <- gsub("\n"," -- ",mostreach.GC$text)
mostreach.GC$name <- gsub("\n"," -- ",mostreach.GC$name)
knitr::kable(
data.frame(
Name = mostreach.boston$name,
Created = mostreach.boston$created_at,
Reach = mostreach.boston$n,
Text = mostreach.boston$text,
stringsAsFactors = FALSE
),
caption = "Boston Tweets with Most 'Reach'"
)| Name | Created | Reach | Text |
|---|---|---|---|
| The Weather Channel | 2019-01-17 18:55:52 | 3611276 | #Boston (Logan) still hasn’t had an inch of #snow yet this season. Here’s how strange that is: https://t.co/DRnvNJu2Rv https://t.co/xvi4cVmuG2 |
| Gazzetta_NBA | 2019-01-15 08:06:08 | 1668788 | #Nba #Harden travolge #Memphis e supera #KobeBryant. #Boston, k.o. con i #Nets https://t.co/oKjW0GxoZ6 #NBA https://t.co/uLIb2LFmxl |
| City of Boston | 2019-01-15 22:09:08 | 1350996 | Tonight, Mayor @marty_walsh will give his annual State of the City address. The #SOTC2019 will review the City of #Boston’s progress and lay out the Mayor’s agenda for this year. You’ll be able to watch the live stream at https://t.co/k4bF6mHvMb @BostonCityTV https://t.co/oQPo9yHkUW |
| Mike Massimino | 2019-01-15 11:59:02 | 1244124 | Sunrise in #Boston, have a great day today! https://t.co/Gej2Cb1Uhv |
| Fast Freddy Murphy | 2019-01-18 03:02:19 | 1139248 | So great to hang with our #homegirl #FrankieShaw back in #Boston to #hype her Hit Series #SMILF 💕 Don’t miss the Season2 premiere THIS Sunday night (1/20) on @Showtime @frankieshawisag @svilletheatre @SHO_SMILF #showtime @Mix1041 @Rosie #southie @saloondavis #lifeinthefastlane https://t.co/PBsRok2XUj |
| Evan Kirstel | 2019-01-12 17:49:19 | 1096538 | The joy of train travel #Boston to #NYC @Amtrak #NewEngland #travel #photography https://t.co/LWGmHqTGz7 https://t.co/jwB57vEnBd |
| Judy Woodruff | 2019-01-16 23:53:59 | 1093865 | moving court for homeless people to a shelter: a successful #Boston experiment, reports @TinaAroundTown @NewsHour tonight |
| Evan Kirstel | 2019-01-11 13:38:30 | 1079890 | 🦁 🦁 🦁 🚗 🚙 🚗 And you thought you had a tough commute #boston https://t.co/QQDu8bz8s9 |
| Biz Comm Strategies | 2019-01-11 01:38:03 | 1030163 | #Boston - Humatics https://t.co/EyePvq0nBT Raises $28M led by Tenfore with #Boulder @BlackhornVC @Fontinalis_FP @AirbusVentures for #Spatial #Intelligence via @growthcapnews #VC #capital #funding #news https://t.co/FIOzl52lH3 – – connect with @evankirstel to accelerate your growth https://t.co/7A5XZmwBFP |
| Ayanna Pressley | 2019-01-15 23:10:23 | 1010829 | Point of clarification: Just so there is no confusion or trouble, especially on today. I am not a member of #AKA I am however a proud sister of @linksinc #Boston chapter. Many of my link sisters & new #CBC colleagues (see Lauren below) are Happy #FoundersDay #HU #1908 #sisterhood https://t.co/lpmMtXLLpY |
knitr::kable(
data.frame(
Name = mostreach.GC$name,
Created = mostreach.GC$created_at,
Reach = mostreach.GC$n,
Text = mostreach.GC$text,
stringsAsFactors = FALSE
),
caption = "Guatemala City Tweets with Most 'Reach'"
)| Name | Created | Reach | Text |
|---|---|---|---|
| José E. Valdizán | 2019-01-18 07:05:49 | 93594 | Vista Hermosa zona 15, Guatemala #cityscape #city #guatemala #guatemalacity #guate #guategram #view #drone #droneview #dronestagram #vistahermosaguatemala #life #citylife #citylifestyle… https://t.co/IX3ImlKSel |
| José E. Valdizán | 2019-01-14 14:38:08 | 92930 | Edificio del Banco Industrial y Plazuela 11 de marzo #guatemala #guatemalacity #streets #guate #streetstyle #streetview #view #streetlife #city #citylife #centralamerica #dji… https://t.co/GmIbX4nR9b |
| Guatemala | 2019-01-16 16:50:19 | 58238 | OTRA OPCIÓN AL #TRÁNSITOGT – – De ingreso a #CiudadDeGuatemala por el sur del país. Tome nota de otra vía al #TráficoGT. https://t.co/zpTq2SRywb |
| Guatemala | 2019-01-16 16:08:29 | 58051 | PERSONA FALLECIDA – – 1ªAv. y 4ªC. #zona3, aldea #BocaDelMonte, #VillaCanales. – #TránsitoGT hacia #CiudadDeGuatemala bloqueado, desvío por La Joya. – – I. #TráficoGT: @PMTVILLACANALES https://t.co/I0t7Md2gHY |
| Guatemala | 2019-01-16 16:30:02 | 58051 | OTRA OPCIÓN AL #TRÁNSITOGT – – De ingreso a #CiudadDeGuatemala por el sur del país. Tome nota de otra vía al #TráficoGT. https://t.co/ibFtEGXAPv |
| Guatemala | 2019-01-16 17:18:43 | 58051 | OTRA OPCIÓN AL #TRÁNSITOGT – – De ingreso a #CiudadDeGuatemala por el sur del país. Tome nota de otra vía al #TráficoGT. https://t.co/DBi5TMFWoD |
| Noticiero El Vigilante | 2019-01-11 16:12:00 | 36823 | hacia #CiudaddeGuatemala. – Actualmente circula por el #kilómetro22 de la ruta #Interamericana hacia la ciudad. Tome sus #precauciones. – – Vía: @EmixtraPablo |
| CruzRojaGT | 2019-01-12 17:53:25 | 33133 | #CiudadDeGuatemala – – Accidente de tránsito se suscita en 8av 2Calle zona 1, dos vehículos colisionan, socorristas de #CruzRojaGT le brindaron atención prehospitalaria a una persona con heridas leves en el lugar, no ameritó ser trasladada. https://t.co/rCUw93iwvT |
| Therealhotinri | 2019-01-14 04:05:32 | 24088 | Special shout out to eastnewlos from all the way from #GuatemalaCity and congratulations on opening your barbershop #broadwaybarbershop & getting your copies of the… https://t.co/L7VEP27sxJ |
| El Vigilante | 2019-01-11 16:12:03 | 17620 | hacia #CiudaddeGuatemala. – Actualmente circula por el #kilómetro22 de la ruta #Interamericana hacia la ciudad. Tome sus #precauciones. – – Vía: @EmixtraPablo |
wordcloud_plot(
con,
start.date = Sys.Date()-7,
where.criteria = "query_text.location = 'Boston'",
caption = "Boston"
)
wordcloud_plot(
con,
start.date = Sys.Date()-7,
where.criteria = "query_text.location = 'Guatemala City'",
caption = "Guatemala City"
)timeplot(
con,
start.date = Sys.Date()-7,
where.criteria = "query_text.location = 'Guatemala City' OR query_text.location = 'Boston'",
group.column = "query_text.location",
log.scale=TRUE
)
#> Warning: Removed 2 rows containing missing values (geom_path).# Import igraph
library(igraph)
library(sigmajs)
library(visNetwork)
usermention.query <- sprintf("SELECT LOWER(status.screen_name) as mentioner,LOWER(user_mention.user_mention_screen_name) as mentioned, status.id as status_id, status.text as status_text, status.created_at as created_at FROM status JOIN search_status ON status.id = search_status.status_id JOIN query_text ON search_status.query_id = query_text.id JOIN user_mention ON status.id = user_mention.status_id WHERE status.created_at > '%s' AND query_text.location = 'Boston';",format(Sys.Date()-7))
usermentions.df <- DBI::dbGetQuery(con,usermention.query)
if(nrow(usermentions.df) > 0){
g <- graph_from_data_frame(usermentions.df)
vertices.df <- data.frame(index=as.integer(V(g)), screen_name = names(V(g)),stringsAsFactors = FALSE)
}if(nrow(usermentions.df) > 0){
ec <- centr_eigen(g,directed=FALSE)
df <- data.frame(
Screen_Name = paste(
"@",
vertices.df$screen_name,
sep=""
),
Eig_Centrality = as.numeric(ec$vector)
)
df <- df[order(df[,2],decreasing=TRUE),]
knitr::kable(
df[1:10,],
row.names = FALSE,
caption = "User Mention Network Eigenvector Centrality (Boston)"
)
}| Screen_Name | Eig_Centrality |
|---|---|
| @malunahe | 1.0000000 |
| @wizard_leather | 0.8737539 |
| @roxanneshelaide | 0.7379871 |
| @rossepemberton | 0.0925739 |
| @millamanda07 | 0.0620105 |
| @dallasbestplace | 0.0053268 |
| @dararmerlin | 0.0000284 |
| @dolly_jewel | 0.0000284 |
| @nicolenmorris3 | 0.0000002 |
| @ferraverta | 0.0000000 |
if(nrow(usermentions.df) > 0){
bc <- centr_betw(g,directed=FALSE)
df <- data.frame(
Screen_Name = paste(
"@",
vertices.df$screen_name,
sep=""
),
Bet_Centrality = as.numeric(as.numeric(bc$res))
)
df <- df[order(df[,2],decreasing=TRUE),]
knitr::kable(
df[1:10,],
caption = "User Mention Network Betweenness Centrality (Boston)"
)
}| Screen_Name | Bet_Centrality | |
|---|---|---|
| 2375 | @marty_walsh | 4069937.1 |
| 7024 | @patriots | 3044090.2 |
| 581 | @wcvb | 2596631.1 |
| 52 | @cityofboston | 2534060.3 |
| 1810 | @tomsullboston | 1677127.1 |
| 7069 | @bostonglobe | 1477934.8 |
| 7179 | @celtics | 1110462.7 |
| 13 | @bostonhistory | 1097387.7 |
| 203 | @jaykelly26 | 1026088.2 |
| 472 | @evankirstel | 975555.1 |
if(nrow(usermentions.df) > 0){
verts <- data.frame(
name = vertices.df$screen_name,
label = vertices.df$screen_name,
title = vertices.df$screen_name,
stringsAsFactors = FALSE
)
for(n in names(verts)){
g <- set_vertex_attr(g,n,value=verts[,n])
}
plot(
g,
vertex.size=4,
vertex.label=NA,
main = "User Mention Plot (Boston)"
)
}This is a final network model, using the retweet network.
retweet.query <- sprintf("SELECT status_retweet.screen_name as retweeter,status_original.screen_name as retweeted, status_retweet.id as status_id, status_retweet.text as retweet_text, status_original.text as original_text, status_retweet.created_at as created_at FROM status as status_retweet JOIN status as status_original ON status_retweet.retweet_status_id = status_original.id JOIN search_status ON status_retweet.id = search_status.status_id JOIN query_text ON search_status.query_id = query_text.id WHERE status_original.created_at > '%s' AND status_retweet.retweet = 1 AND query_text.location = 'Boston' GROUP BY retweeter,retweeted;",format(Sys.Date()-7))
retweets.df <- DBI::dbGetQuery(con,retweet.query)
if(nrow(retweets.df) > 0){
g <- graph_from_data_frame(retweets.df)
vertices.df <- data.frame(index=as.integer(V(g)), screen_name = names(V(g)),stringsAsFactors = FALSE)
}if(nrow(retweets.df) > 0){
ec <- centr_eigen(g,directed=FALSE)
df <- data.frame(
Screen_Name = paste(
"@",
vertices.df$screen_name,
sep=""
),
Eig_Centrality = as.numeric(ec$vector)
)
df <- df[order(df[,2],decreasing=TRUE),]
knitr::kable(
df[1:10,],
caption = "Retweet Network Eigenvector Centrality (Boston)"
)
}| Screen_Name | Eig_Centrality | |
|---|---|---|
| 4903 | @FerRaverta | 1.0000000 |
| 1072 | @Gustavodomecq41 | 0.0647841 |
| 2870 | @alitapaz | 0.0647841 |
| 2096 | @QuemeroMDQ | 0.0645436 |
| 4804 | @van_assef | 0.0645436 |
| 1930 | @NoraRS06 | 0.0645414 |
| 2293 | @SchettinoPablo | 0.0645414 |
| 4041 | @marioarqueros | 0.0643074 |
| 2683 | @Vir_Sivori | 0.0640103 |
| 3976 | @lococreed | 0.0640103 |
if(nrow(retweets.df) > 0){
bc <- centr_betw(g,directed=FALSE)
df <- data.frame(
Screen_Name = paste(
"@",
vertices.df$screen_name,
sep=""
),
Bet_Centrality = as.numeric(bc$res)
)
df <- df[order(df[,2],decreasing=TRUE),]
knitr::kable(
df[1:10,],
caption = "Retweet Network Betweenness Centrality (Boston)"
)
}| Screen_Name | Bet_Centrality | |
|---|---|---|
| 2699 | @WCVB | 815220.7 |
| 389 | @BostonHistory | 485779.5 |
| 3712 | @jaykelly26 | 386623.6 |
| 4431 | @redostoneage | 342514.0 |
| 1248 | @J_A_P_S_C_ | 338902.0 |
| 4976 | @BostonPWD | 331947.6 |
| 149 | @Alpha_Omega_Yah | 329565.0 |
| 585 | @CityOfBoston | 317203.6 |
| 4949 | @CharlieOnMTA | 296663.9 |
| 4957 | @sjforman138 | 283080.8 |
if(nrow(retweets.df) > 0){
verts <- data.frame(
name = vertices.df$screen_name,
label = vertices.df$screen_name,
title = vertices.df$screen_name,
stringsAsFactors = FALSE
)
for(n in names(verts)){
g <- set_vertex_attr(g,n,value=verts[,n])
}
plot(g,vertex.color=vertex_attr(g,"color"),vertex.size=4,vertex.label=NA)
}